package com.data.modules.online.cgform.converter.p010b;

import com.alibaba.fastjson.JSONArray;
import java.util.ArrayList;
import com.data.common.system.vo.DictModel;
import com.data.modules.online.cgform.converter.p009a.ForeseeConvert;
import com.data.modules.online.cgform.entity.OnlCgformField;

public class SwitchConverter extends ForeseeConvert {
    public SwitchConverter(OnlCgformField onlCgformField) {
        JSONArray parseArray;
        String fieldExtendJson = onlCgformField.getFieldExtendJson();
        String str = "Y";
        String str2 = "N";
        if (fieldExtendJson != null && !"".equals(fieldExtendJson) && (parseArray = JSONArray.parseArray(fieldExtendJson)) != null && parseArray.size() == 2) {
            str = parseArray.get(0).toString();
            str2 = parseArray.get(1).toString();
        }
        ArrayList arrayList = new ArrayList();
        DictModel dictModel = new DictModel(str, "是");
        DictModel dictModel2 = new DictModel(str2, "否");
        arrayList.add(dictModel);
        arrayList.add(dictModel2);
        this.f123b = arrayList;
        this.f122a = onlCgformField.getDbFieldName();
    }
}
